﻿Imports System.Runtime.CompilerServices
Imports System.Web.Mvc

Namespace Helper

    Public Module LabelExtensions

        <Extension()> _
        Public Function LabelExtension(ByVal helper As HtmlHelper, ByVal target As String, ByVal text As String,
                                                 Optional ByVal isOptional As Boolean = False) As MvcHtmlString
            Return New MvcHtmlString(
                String.Format("<label for='{0}'> {1} {2}</label>", target, text, IIf(isOptional, "<b class=""red"">*</b>", "")))
        End Function

    End Module

End Namespace
